package top.timestreet.xmsk.base.pipeline;

import java.util.ArrayList;
import java.util.List;

import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.pipeline.CollectorPipeline;

/**
* @author TateLiao
 * @param <T>
* @data 2019年6月9日
*/
public class BasePipeline<T> implements CollectorPipeline<T> {

	private List<T> list = new ArrayList<>();
	
	@Override
	public synchronized void process(ResultItems resultItems, Task task) {
		list.addAll(resultItems.get("list"));
	}

	@Override
	public List<T> getCollected() {
		return list;
	}

}